package com.wn.controller;

import com.wn.api.UserApi;
import com.wn.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author yellow Docter
 * @date 2023 -02-21
 * @desc
 */
@RestController
@RequestMapping("consumer")
public class UserConsumerController {

    @Autowired
    private UserApi userApi;

    @GetMapping("{id}")
    public User findUserById(@PathVariable("id") Integer id) {
        return userApi.findUserById(id);
    }

    @DeleteMapping("{id}")
    public String deleteUserById(@PathVariable("id") Integer id) {
        return userApi.deleteUserById(id);
    }
}
